<template>
    <article class="post post-list" wid="post">
        <div class="post-entry">
            <h1 class="entry-title">
                <a target="_blank" :href="`/article/${post.id}`"><span v-if="post.isTopping" style="color:#2ea7e0;font-weight:600">[置顶] </span>{{post.title}}</a>
            </h1>
			<div class="feature">
				<!-- <el-tooltip class="item" effect="dark" :content="post.parentCategoryName" placement="top-start">
				<p class="category">{{post.parentCategoryName}}</p>
				</el-tooltip> -->
			    <a target="_blank" :href="`/article/${post.id}`">
			        <!-- <img :src="post.image" alt="加载失败"/> -->
					<w-image  :image="post.image"></w-image>
			    </a>
				<p class="summary">{{post.abstract1}}</p>
			</div>
            <div class="p-time">
                <i class="iconfont iconmeditor-time"></i> {{post.createDate}}<i v-if="post.isHot" class="iconfont iconfire" style="margin-left: 5px;color: #ff6d6d;"></i>
            </div>
            <footer class="entry-footer">
                <div class="post-more">
                    <a target="_blank" :href="`/article/${post.id}`"><i class="iconfont iconfish-li" style="font-size: 25px;"></i></a>
                </div>
                <div class="info-meta">
                    <div class="comnum">
                        <span>
                            <i class="iconfont iconcomment"></i>
                            <a>{{post.comments}} 条评论</a>
                        </span>
                    </div>
                    <div class="views">
                        <span><i class="iconfont iconeyes"></i>{{post.count}} 阅读</span>
                    </div>
                </div>
            </footer>
        </div>
        <hr/>
    </article>
</template>

<script>

    export default {
        name: "post",
        props: {
            post: {
                type: Object
            }
        }
    }
</script>
<style lang="less">
	[wid='post']{
		.el-image{
			border-radius: 10px;
		}
	img,.el-image__inner,.image-slot {
		text-align: center;
	    width: 120px;
	    height: 100px;
	    object-fit: cover;
	    border-radius: 10px;
		vertical-align: top;
	    /* border: 1px solid #DADADA; */
	    transition: all 0.2s linear;
	    overflow: hidden;
	    &:hover {
	        transform: scale(1.1, 1.1);
	        filter: contrast(130%);
	    }
	}
	}
</style>
<style scoped lang="less">
    .post {
        margin: 0 0 4% 0;
        position: relative;
		margin-bottom: 0;
    }

    .post-entry {
		padding-bottom: 20px;
        .feature {
            /* position: absolute;
            margin-top: 10px; */
			position: relative;
			.category{
				width: 60px;
				position: absolute;
				top: 0;
				overflow: hidden;
				height: 22px;
				z-index: 1;
				background-color: rgba(18,182,221,.8);
				color: #FFFFFF;
				border-radius: 1px;
				padding: 5px;
				font-size: 16px;
				left: 10px;
			}
			p{
				display: inline-block;
			}
        }

        .entry-title {
            font-size: 21px;
            font-weight: 600;
            line-height: 50px;
            /* margin: 0 0 0 17%; */
            position: relative;
            z-index: 1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            width: 70%;
            color: #000000;

            & a:hover {
                color: #8fd0cc;
            }
        }

        .p-time {
            position: absolute;
            right: 0;
            top: 16px;
            font-size: 12px;
            color: #989898;
            letter-spacing: 1px;
            font-family: din, 'Hiragino Sans GB', 'Microsoft Yahei', Arial, sans-serif;
            display: flex;
            align-items: center;
        }

        p.summary {
            min-height: 60px;
            margin: 0 0 0 20px;
            font-size: 15px;
            color: #6f6f6f;
            letter-spacing: 1px;
            line-height: 30px;
			position: absolute;
			top: 0;
			left: 120px;
        }

        footer.entry-footer {
            margin: 0 0 0 17%;
            list-style: none;

            .post-more {
                /* margin-top: 10px; */
                text-align: right;
                color: #A0DAD0;
				position: absolute;
				right: 10px;
				bottom: 10px;
                a:hover {
                    color: #737373;
                }
            }

            .info-meta {
                margin-top: 10px;
                font-family: din, 'Hiragino Sans GB', 'Microsoft Yahei', Arial, sans-serif;
                position: absolute;
                top: 20px;
                opacity: 0;
                padding-top: 8px;
                border-top: 1px solid #ddd;
                -webkit-transform: translate3d(-150px, 0, 0);
                transform: translate3d(-150px, 0, 0);
                visibility: hidden;
                transition: .7s all ease;
                -webkit-transition: .6s all ease;
                -moz-transition: .6s all linear;
                -o-transition: .6s all ease;
                -ms-transition: .6s all ease;

                span, a {
                    color: #B3B3B3;
                    font-size: 12px;
                }

                i {
                    margin-top: 3px;
                    margin-right: 10px;
                    float: left
                }
            }

            .comnum {
                float: left;
            }
        }

    }

    .post-entry:hover footer.entry-footer .info-meta {
        -webkit-transform: translate3d(-230px, 0, 0);
        transform: translate3d(-230px, 0, 0);
        opacity: 1;
        visibility: visible;
    }

    .post hr {
        /* width: 30%; */
        height: 1px;
        margin: 0 auto;
        border: 0;
        background: #EFEFEF;
    }

    /*******/
    @media (max-width: 1060px) {
        .info-meta{
            display: none;
        }
    }
    @media screen and (max-width: 1024px) {
        .post-entry {
			padding-bottom: 5px;
            .feature img {
                width: 50px;
                height: 50px;
            }
            .entry-title{
                font-size: 14px;
                line-height: 30px;
            }
            .p-time {
				display: none;
            }
            p.summary {
                font-size: 12px;
                height: 30px;
                overflow: hidden;
				left: 60px;
				margin: 0;
            }
            .post-more{
                display: none;
            }
        }
    }

    /******/
</style>
<style lang="less">
	@media screen and (max-width: 1024px) {
		.post-entry {
		.el-image {
			img{
		    width: 50px !important;
		    height: 50px !important;
			}
			.image-slot{
				width: 50px !important;
				height: 50px !important;
			}
		}
		}
	}
</style>